﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using InventoryBusinessLogic.CustomerManagementDataContract;

namespace InventoryShell.CustomerManagement
{
    public partial class NewCustomer : UserControl
    {
        public NewCustomer()
        {
            Collection = new System.Collections.Generic.List<CustomerType>();
            InitializeComponent();
        }

        private void labelX3_Click(object sender, EventArgs e)
        {

        }

        private void btnCreate_Click(object sender, EventArgs e)
        {

        }

        private void txtContactWebSite_TextChanged(object sender, EventArgs e)
        {

        }

        private void txtAddress_TextChanged(object sender, EventArgs e)
        {

        }

        private void groupPanel5_Click(object sender, EventArgs e)
        {

        }

        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {

            #region Basic Details

            string Name = txtBasicName.Text;
            string LastName = txtBasicLastName.Text;
            string Balance = txtBasicLastName.Text;
            
            #endregion

            #region Purchasing Details

            string price = txtPurchasingPricing.Text;

            string Discount = txtPurchasingDiscount.Text;

            string Terms = txtPurchasingTerms.Text;

            #endregion

            #region Contact Details

            string Fax = txtContactFax.Text;
            string email = txtContactEmail.Text;
            string Phone = txtContactPhone.Text;
            string WebSite = txtContactWebSite.Text;

            #endregion

            #region Address Details

            string Address = txtAddress.Text;

            #endregion

            #region Search

            string SearchName = txtSearchName.Text;

            string SearchMail = txtSearchMail.Text;

            string SearchLocation = txtSearchLocation.Text;

            #endregion

            CustomerType cust = new CustomerType();

            cust.CustomerBalance = Balance;

            cust.CustomerDiscount = Discount;

            cust.CustomerEmail = email;

            cust.CustomerFax = Fax;

            cust.CustomerLastName = LastName;

            cust.CustomerLocation = SearchLocation;

            cust.CustomerName = Name;

            cust.CustomerPhone = Phone;

            cust.CustomerPricing = price;

            cust.CustomerTerms = Terms;

            cust.CustomerWebSite = WebSite;

            this.Collection.Add(cust);

            CommonGridView.DataSource = null;

            CommonGridView.DataSource = this.Collection;          

        }
       
    }


    //public class Customer
    //{

    //    public string CustomerName { get; set; }

    //    public string CustomerLastName{ get; set; }

    //    public string CustomerLocation { get; set; }

    //    public string CustomerEmail { get; set; }

    //    public string CustomerBalance { get; set; }

    //    public string CustomerPricing { get; set; }

    //    public string CustomerDiscount { get; set; }

    //    public string CustomerTerms { get; set; }

    //    public string CustomerFax{ get; set; }

    //    public string CustomerPhone { get; set; }

    //    public string CustomerWebSite{ get; set; } 
    //}
}
